Introduction:

The Data is collected from the FEMA website.

Data Cleaning Steps

step one - choose the ‘Hurricane’ as the incident of type - the incident type will affect the types of assistance available

step two - choose the year from 2009 to 2020

#Read Data: The data is saved from the data cleaning process.rmd

##   X disasterNumber year pwNumber dcc      damageCategory projectSize  county
## 1 1           1866 2009        1   F    Public Utilities       Large  Mobile
## 2 2           1866 2009        2   F    Public Utilities       Large  Mobile
## 3 3           1866 2009        3   F    Public Utilities       Large  Mobile
## 4 4           1866 2009        4   F    Public Utilities       Small  Mobile
## 5 5           1866 2009        5   B Protective Measures       Small  Mobile
## 6 6           1866 2009        6   B Protective Measures       Small Baldwin
##   countyCode   state stateCode stateNumberCode projectAmount
## 1         97 Alabama        AL               1          0.00
## 2         97 Alabama        AL               1      58425.34
## 3         97 Alabama        AL               1          0.00
## 4         97 Alabama        AL               1      12778.47
## 5         97 Alabama        AL               1      15290.26
## 6          3 Alabama        AL               1       9820.02
##   federalShareObligated totalObligated
## 1                  0.00           0.00
## 2              43819.01       43819.01
## 3                  0.00           0.00
## 4               9583.85        9583.85
## 5              11467.70       11467.70
## 6               7365.02        7365.02

Goal

Adding fips to the data.

Calculating the sum of project Amount for each county in 2009-2020.

## # A tibble: 8 x 9
## # Groups:   fips, state, county [1]
##    fips state   county   year project  long   lat group order
##   <int> <chr>   <chr>   <int>   <dbl> <dbl> <dbl> <dbl> <int>
## 1  1001 alabama autauga  2017   7016. -86.5  32.3     1     1
## 2  1001 alabama autauga  2017   7016. -86.5  32.4     1     2
## 3  1001 alabama autauga  2017   7016. -86.5  32.4     1     3
## 4  1001 alabama autauga  2017   7016. -86.6  32.4     1     4
## 5  1001 alabama autauga  2017   7016. -86.6  32.4     1     5
## 6  1001 alabama autauga  2017   7016. -86.6  32.4     1     6
## 7  1001 alabama autauga  2017   7016. -86.6  32.4     1     7
## 8  1001 alabama autauga  2017   7016. -86.6  32.4     1     8

Using ggplot to draw a map for the total project amount of each state.

Calculating the sum of federalShareObligated in 2009-2020

## # A tibble: 8 x 5
## # Groups:   fips, state, county [6]
##    fips state   county    year  federal
##   <int> <chr>   <chr>    <int>    <dbl>
## 1  1001 alabama autauga   2017    5262.
## 2  1003 alabama baldwin   2009 2299946.
## 3  1003 alabama baldwin   2012 2655912.
## 4  1003 alabama baldwin   2017 1064986.
## 5  1005 alabama barbour   2017    8265.
## 6  1015 alabama calhoun   2017    7160.
## 7  1017 alabama chambers  2017   11063.
## 8  1025 alabama clarke    2017   12403.

Using ggplot to draw a map for the total federal share Obligrated of each state

Using ggplotly

Now,I am trying to use ggplotly to show a clearer map for the previous dataframes.

Results/Observations

What can improve or add

References

Hadley Wickham, Romain François, Lionel Henry and Kirill Müller (2020). dplyr: A Grammar of Data Manipulation. R package version 1.0.2. https://CRAN.R-project.org/package=dplyr

Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686

Stefan Milton Bache and Hadley Wickham (2014). magrittr: A Forward-Pipe Operator for R. R package version 1.5. https://CRAN.R-project.org/package=magrittr

Original S code by Richard A. Becker, Allan R. Wilks. R version by Ray Brownrigg. Enhancements by Thomas P Minka and Alex Deckmyn. (2018). maps: Draw Geographical Maps. R package version 3.3.0. https://CRAN.R-project.org/package=maps

C. Sievert. Interactive Web-Based Data Visualization with R, plotly, and shiny. Chapman and Hall/CRC Florida, 2020.